Group Types
The base class of group object is of type
kQ3ShapeTypeGroup
, a type of shape object. You can create a group of that type (by calling the
Q3Group_New
function) and you can put any kinds of shared objects into it (for example, by calling the
Q3Group_AddObject
function). In addition, QuickDraw 3D provides three subclasses of groups: light groups, display groups, and information groups. These subclasses are distinguished from one another by the kinds of objects you can put into them.
-
A
light group
is a group that contains one or more lights (and no other types of QuickDraw 3D objects). You'll typically create light groups to provide illumination on the objects in a model. The light group is attached to a view object by calling the
Q3View_SetLightGroup
function. See the chapter
"View Objects"
for complete details on attaching light groups to views.
-
A
display group
is a group of objects that are drawable. Drawable objects include geometric objects, styles, transforms, attributes and attribute sets, and other display groups. When you draw a display group into a view, each object in the group is executed (that is, drawn) in the order in which it appears in the group (which is determined by the order in which the objects were inserted into the group). You can create a display group, or you can create one of two subclasses of display groups: ordered display groups and I/O proxy display groups.
-
An
ordered display group
is a display group in which the objects in the group are sorted by their type. Ordered groups are sometimes more useful than unordered groups because the order of object execution is always the same. During rendering, QuickDraw 3D executes objects in this order:
-
transforms
-
styles
-
attribute sets
-
shaders
-
geometric objects
-
groups
-
unknown objects
This order of execution ensures that all transforms, styles, attribute sets, and shaders in a group are applied to the geometric objects, groups, and unknown objects that form the hierarchy below the ordered display group.
-
An
I/O proxy display group
(or sometimes
proxy display group
) is a display group that contains several representations of a single geometric object. You can use I/O proxy display groups to encapsulate, in a metafile, two or more descriptions of an object. This is useful when an application reading the file is unable to understand some of those descriptions. For example, you might know that some other applications cannot handle NURB patches but do handle meshes. As a result, you can create an I/O proxy display group that contains two descriptions of a surface (one as a NURB patch and one as a mesh) and write that group into a metafile. Any application reading the metafile can select from the display group the representation of the surface that it can work with. You should put objects into the I/O proxy display group in the order you deem to be preferable. (In other words, the first object in the group should be the representation you deem most useful, and the last object should be the one that you deem least useful.) In this way, an application reading the metafile can simply use the first object in the proxy display group whose type is not
kQ3SharedTypeUnknown
.
-
An
information group
is a group that contains one or more strings (and no other types of QuickDraw 3D objects). You'll typically create information groups to provide human-readable information in a metafile. For example, if you want to include a copyright notice in a metafile, you can simply create an information group that contains a string of the appropriate data and then write that group to the metafile.
© 1997 Apple Computer, Inc.
Previous | QD3D Book | Overview | Chapter Contents | Next |